package com.church.daoimpl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.church.dao.GroupDao;
import com.church.db.Group;

public class GroupDaoImpl extends HibernateDaoSupport implements GroupDao {

	@Override
	public List<Group> getGroup() {
		return this.getHibernateTemplate().find("from Group");
	}

	@Override
	public Group getGroupById(long id) {
		List<Group> list=this.getHibernateTemplate().find("from Group as gp where gp.id="+id);
		if(list.size()>0)
		{
			return list.get(0);
		}
		return null;
	}

}
